/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package projetofinal;

import com.jgoodies.forms.builder.PanelBuilder;
import com.jgoodies.forms.factories.CC;
import com.jgoodies.forms.layout.FormLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JTextField;

/**
 *
 * @author Will
 */
public class FormJGood extends JFrame {
    
    private JTextField  nome;
    private JTextField  email;
    private JButton     cadastrar;
    
    public FormJGood(){
        init();
        layoutComponets();
    }

    private void init() {
        nome = new JTextField();
        email = new JTextField();
        cadastrar = new JButton("Cadastrar");
    }

    private void layoutComponets() {
        String colunas = "pref, 5dlu, fill:pref:grow";
        String linhas  = "pref, pref, pref";
        
        FormLayout layout = new FormLayout(colunas, linhas);
        PanelBuilder builder = new PanelBuilder(layout);
        
        builder.addLabel("Nome: ", CC.xy(1, 1));
        builder.add(nome, CC.xy(3, 1));
        
        builder.addLabel("Email: ", CC.xy(1, 2));
        builder.add(email, CC.xy(3, 2));
        
        builder.add(cadastrar, CC.xy(1, 3));
        
        add(builder.getPanel());
    }
    
}
